﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
		<link href="css/table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/opentable.js"></script>
		<script type="text/javascript" src="js/openwindow.js"></script>
		<script type="text/javascript">
	function page(currentPage){
		$("#pageId").val(currentPage);
		document.pageForm.submit();
	}
	
	 function g_sss()
    {
        window.onresize = loadChange();
    }
function clearInfo(){
	$("#account").val("");
	$("#name").val("");
	document.searchForm.submit();
}	
		function deleteRoleUser(roleId){
				var arry="roleId="+roleId;
				var count=0;
				var checks=$("input[name='ids']");
				for(var i=0;i<checks.length;i++){
					if(checks[i].checked){
						arry+="&ids="+checks[i].value;
						count++;
					}
				}
				if(count==0){
					alert("请选择要移除的数据！");
					return;
				}
				if(confirm("确定要移除？")){
					$.post("deleteRoleUser.action",arry,function(data){
						if(data=="success"){
						alert("操作成功！");
						var currentPage=$("#currentPage").val();
						page(currentPage);
						var frame = window.parent.document.getElementById("noFrame");
						frame.src = "userNoCurRoleList.action?roleId=${roleId}";
						}else{
							alert("操作失败！");
						}
					});
				}
}

</script>

	</head>

	<body onload="g_sss()">
		<div class="topdiv" style="height: 40px;">
			<form action="userRoleList.action" method="post" name="searchForm">
				<input name="roleId" value="${roleId}" type="hidden"/>
				<div >
					 帐户：
					<input type="text" id="account" name="account" value="${account}" />
					&nbsp;&nbsp; 姓名：
					<input type="text" id="name" name="name" value="${name}" />
					<input type="submit" value="立即查找" class="button_04" />
					<input type="button" onclick="clearInfo();" value="清除"
						class="button_02" />

				</div>
			</form>
		</div>

		<table   border="0" cellpadding="0" cellspacing="0" width="100%">
			<tbody>
				<tr>
					<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
					<td style="background: url('image/wsoa_window_002.gif');">
						<table border="0" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td align="center"
										style="background: url('image/wsoa_window_002.gif');"
										width="10">
										<img src="image/center_19.gif">
									</td>
									<td align="center"
										style="background: url('image/wsoa_window_002.gif');"></td>
									<td>
										系统管理 &gt; 角色管理 &gt; 用户指定 &gt; 已授权<font style="color: red; font-weight: bold;">${orole.name}</font>角色的用户
									</td>
								</tr>
							</tbody>
						</table>
					</td>
					<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
				</tr>
				<tr>
					<td style="background: url('image/wsoa_window_010.gif');" width="1">
						&nbsp;
					</td>
					<td>

						<table class="intable">
							<tr>
								<td>
									<input type="button" onclick="deleteRoleUser('${roleId}')" value="移除"
										class="button_02" />
								</td>
							</tr>
						</table>

						<table id="tabllist" class="righ_list" frame="box" cellspacing="1"
							cellpadding="0" width="100%" border="0">
							<tr class="reigh_list2">
								<th align="left" class="bg_tr" width="5%">
									<input type="checkbox" onclick="checkAll()" id="all">
								</th>
								<th align="left" width="8%">
									账户
								</th>
								<th align="left" width="20%">
									姓名
								</th>
								<th align="left" width="15%">
									手机
								</th>
								<th align="left">
									部门
								</th>
							</tr>
							<c:if test="${empty userList}">
								<tr id="row">
									<td colspan="10">
										没有相关记录！
									</td>
								</tr>
							</c:if>
							<c:forEach items="${userList}" var="user">
								<tr id="row" onmouseover="overStyle(this)"
									onmouseout="outStyle(this)">
									<td align="center">
										<input type="checkbox" name="ids" value="${user.id}">
									</td>
									<td>
										${user.account}
									</td>
									<td>
										${user.name}
									</td>
									<td>
										${user.phone}
									</td>
									<td>
										${user.orgName}
									</td>
								</tr>
							</c:forEach>
						</table>

					</td>
					<td style="background: url('image/wsoa_window_006.gif');" width="1">
						&nbsp;
					</td>
				</tr>
				<tr>
					<td height="1" width="1">
						<img src="image/wsoa_window_009.gif" height="16" width="14">
					</td>
					<td style="background: url('image/wsoa_window_008.gif');"
						height="1"></td>
					<td height="1" width="1">
						<img src="image/wsoa_window_007.gif" height="16" width="12">
					</td>
				</tr>
			</tbody>
		</table>
		<div class="pageDiv">
		<form action="userRoleList.action" method="post" name="pageForm">
			<input type="hidden" name="account" value="${account}">
			<input type="hidden" name="name" value="${name}">
			<input type="hidden" name="roleId" value="${roleId}">
			<input type="hidden" id="pageId" name="currentPage">
			<%@include file="../page/page.jsp"%>
		</form>
		</div>
	</body>
</html>